package com.aspose.cells;

public class ExternalConnectionCollection extends CollectionBase {
   String b;
   Workbook c;

   ExternalConnectionCollection(Workbook wb) {
      this.c = wb;
      this.b = "http://schemas.openxmlformats.org/spreadsheetml/2006/main";
   }

   public ExternalConnection get(int index) {
      return (ExternalConnection)this.a.get(index);
   }

   public void set(int index, ExternalConnection value) {
      this.a.set(index, value);
   }

   int a(ExternalConnection var1) {
      com.aspose.cells.b.a.a.ze.a(this.a, (Object)var1);
      return this.getCount() - 1;
   }

   public ExternalConnection get(String connectionName) {
      for(int var2 = 0; var2 < this.getCount(); ++var2) {
         ExternalConnection var3 = (ExternalConnection)this.a.get(var2);
         if (com.aspose.cells.b.a.zv.b(var3.getName(), connectionName)) {
            return var3;
         }
      }

      return null;
   }

   public ExternalConnection getExternalConnectionById(int connId) {
      ExternalConnection var2 = null;

      for(int var3 = 0; var3 < this.getCount(); ++var3) {
         var2 = (ExternalConnection)this.a.get(var3);
         if (var2.getConnectionId() == connId) {
            return var2;
         }
      }

      return null;
   }

   void a(ExternalConnectionCollection var1) {
      this.b = var1.b;

      for(int var2 = 0; var2 < var1.getCount(); ++var2) {
         Object var3 = null;
         if (var1.get(var2) instanceof DBConnection) {
            var3 = new DBConnection();
            ((ExternalConnection)var3).a(var1.get(var2));
         } else if (var1.get(var2) instanceof zaro) {
            var3 = new zaro();
            ((ExternalConnection)var3).a(var1.get(var2));
         } else if (var1.get(var2) instanceof zbsr) {
            var3 = new zbsr();
            ((ExternalConnection)var3).a(var1.get(var2));
         } else if (var1.get(var2) instanceof zbve) {
            var3 = new zbve();
            ((ExternalConnection)var3).a(var1.get(var2));
         }

         if (null != var3) {
            this.a((ExternalConnection)var3);
         }
      }

   }
}
